func go/types.assert
180 uses
go/types (current package)
alias.go#L87: assert(a.targs == nil)
alias.go#L155: assert(len(targs) > 0)
assignments.go#L31: assert(isTypes2)
assignments.go#L137: assert(isConstType(x.typ))
assignments.go#L305: assert(!(variadic && hasDots))
builtins.go#L331: assert(!isTypeParam(typ))
builtins.go#L481: assert(!isTypeParam(typ))
builtins.go#L665: assert(isTyped(x.typ))
builtins.go#L982: assert(x.mode != invalid)
builtins.go#L1112: assert(!isUntyped(res))
call.go#L35: assert(T != nil || ix != nil)
call.go#L56: assert(len(targs) == len(xlist))
call.go#L123: assert(got == want)
call.go#L133: assert(check != nil)
call.go#L134: assert(len(targs) == typ.TypeParams().Len())
call.go#L149: assert(inst.TypeParams().Len() == 0) // signature is not generic anymore
call.go#L151: assert(len(xlist) <= len(targs))
call.go#L179: assert(x.mode == value)
call.go#L278: assert(len(targs) == len(xlist))
call.go#L373: assert(n < x.typ.(*Signature).TypeParams().Len())
call.go#L566: assert(len(tparams) == len(targs))
call.go#L602: assert(len(tparams) == len(targs))
call.go#L690: assert(pname.pkg == check.pkg)
call.go#L747: assert(exp.Val() != nil)
check.go#L230: assert(!check.conf._EnableAlias)
check.go#L240: assert(!check.conf._EnableAlias)
check.go#L247: assert(!check.conf._EnableAlias)
check.go#L601: assert(top <= len(check.delayed)) // stack must not have shrunk
const.go#L23: assert(x.mode == constant_)
const.go#L246: assert(v != nil)
const.go#L255: assert(x.mode == constant_)
context.go#L69: assert(ctxt != nil)
context.go#L70: assert(orig != nil)
context.go#L112: assert(inst != nil)
cycles.go#L104: assert(i < 0)
decl.go#L123: assert(obj.Type() != nil)
decl.go#L137: assert(ok)
decl.go#L185: assert(found)
decl.go#L409: assert(obj.typ == nil)
decl.go#L455: assert(obj.typ == nil)
decl.go#L480: assert(lhs == nil || lhs[0] == obj)
decl.go#L518: assert(obj.typ == nil)
decl.go#L569: assert(rhs != nil)
decl.go#L624: assert(rhs != nil)
decl.go#L659: assert(!check.inTParamList)
decl.go#L736: assert(!check.objMap[obj].tdecl.Assign.IsValid()) // don't use TypeName.IsAlias (requires fully set up object)
decl.go#L745: assert(base.TypeArgs().Len() == 0) // collectMethods should not be called on an instantiated type
decl.go#L758: assert(m.name != "_")
decl.go#L759: assert(mset.insert(m) == nil)
decl.go#L767: assert(m.name != "_")
decl.go#L788: assert(m.name != "_")
decl.go#L789: assert(mset.insert(m) == nil)
decl.go#L814: assert(obj.typ == nil)
decl.go#L817: assert(check.iota == nil)
decl.go#L911: assert(obj.typ != nil)
errors.go#L18: func assert(p bool) {
errors.go#L157: assert(code != 0)
errors.go#L167: assert(check.iota != nil)
errors.go#L286: assert(start <= pos && pos < end)
errsupport.go#L56: assert(alt != sel) // otherwise there is no lookup error
expr.go#L1325: assert(hint != nil)
expr.go#L1374: assert(t.Len() != 1)
gcsizes.go#L17: assert(result >= 1)
gcsizes.go#L54: assert(!isTypeParam(T))
gcsizes.go#L104: assert(isTyped(T))
gcsizes.go#L157: assert(!isTypeParam(T))
index.go#L409: assert(ok)
infer.go#L42: assert(inferred == nil || len(inferred) == len(tparams) && !slices.Contains(inferred, nil))
infer.go#L55: assert(n > 0 && len(targs) <= n)
infer.go#L58: assert(params.Len() == len(args))
infer.go#L359: assert(isTyped(d))
infer.go#L375: assert(targ == nil || inferred[i] == targ)
infer.go#L661: assert(n == 0)
infer.go#L674: assert(single.typ.Underlying() == u)
instantiate.go#L55: assert(len(targs) > 0)
instantiate.go#L63: assert(len(tparams) > 0)
instantiate.go#L103: assert(len(ctxts) > 0)
instantiate.go#L151: assert(expanding == nil) // function instances cannot be reached from Named types
labels.go#L61: assert(b.gotoTarget(name) == nil)
lookup.go#L213: assert(f.typ != nil)
lookup.go#L243: assert(m.typ != nil)
lookup.go#L561: assert(isInterfacePtr(T))
mono.go#L219: assert(typ.Obj().Pkg() == pkg)
named.go#L241: defer (func() { assert(!n.stateHas(hasUnder)) })()
named.go#L244: assert(n.fromRHS == nil) // instantiated types are not declared types
named.go#L245: assert(n.loader == nil) // cannot import an instantiation
named.go#L270: assert(n.fromRHS == nil) // not loaded yet
named.go#L271: assert(n.inst == nil) // cannot import an instantiation
named.go#L305: assert(m&lazyLoaded != 0)
named.go#L309: assert(u)
named.go#L313: assert(u)
named.go#L317: assert(u)
named.go#L342: assert(len(targs) > 0)
named.go#L398: assert(t.inst == nil)
named.go#L433: assert(t.inst != nil) // only instances should have unexpanded methods
named.go#L440: assert(len(t.methods) == 0)
named.go#L445: assert(t.inst.ctxt != nil) // we should still have a context remaining from the resolution phase
named.go#L466: assert(origm != nil)
named.go#L522: assert(t.inst == nil)
named.go#L546: assert(samePkg(t.obj.pkg, m.pkg))
named.go#L547: assert(t.inst == nil)
named.go#L582: assert(n.stateHas(lazyLoaded | unpacked))
named.go#L599: assert(n.allowNilRHS)
named.go#L632: assert(n.stateHas(unpacked))
named.go#L651: assert(!seen[t])
named.go#L667: assert(t.rhs() != nil || t.allowNilRHS)
named.go#L754: assert(!n.stateHas(unpacked))
named.go#L755: assert(n.inst.orig.stateHas(lazyLoaded | unpacked))
named.go#L773: assert(n == u)
named.go#L790: assert(iface.complete) // otherwise we are copying incomplete data
object.go#L136: func (obj *object) setOrder(order uint32) { assert(order > 0); obj.order_ = order }
object.go#L613: assert(Identical(typ, &emptyInterface))
operand.go#L333: assert(Vp == nil)
range.go#L123: assert(obj.typ == nil)
range.go#L135: assert(i == 0) // at most one iteration variable (rhs[1] == nil or Typ[Invalid] for rangeOverInt)
range.go#L144: assert(obj.typ != nil)
range.go#L170: assert(i == 0) // at most one iteration variable (rhs[1] == nil or Typ[Invalid] for rangeOverInt)
range.go#L239: assert(typ.dir != SendOnly)
range.go#L252: assert(typ.Recv() == nil)
range.go#L273: assert(cb.Recv() == nil)
recording.go#L34: assert(x.expr != nil && typ != nil)
recording.go#L60: assert(x != nil)
recording.go#L61: assert(typ != nil)
recording.go#L66: assert(val != nil)
recording.go#L69: assert(!isValid(typ) || allBasic(typ, IsConstType))
recording.go#L98: assert(x != nil)
recording.go#L99: assert(len(a) == 2)
recording.go#L104: assert(isTyped(t0) && isTyped(t1) && (allBoolean(t1) || t1 == universeError))
recording.go#L108: assert(tv.Type != nil) // should have been recorded already
recording.go#L134: assert(ident != nil)
recording.go#L135: assert(typ != nil)
recording.go#L142: assert(id != nil)
recording.go#L149: assert(id != nil)
recording.go#L150: assert(obj != nil)
recording.go#L157: assert(node != nil)
recording.go#L158: assert(obj != nil)
recording.go#L165: assert(obj != nil && (recv == nil || len(index) > 0))
recording.go#L173: assert(node != nil)
recording.go#L174: assert(scope != nil)
resolver.go#L106: assert(ident.Name == obj.Name())
sizes.go#L55: assert(result >= 1)
sizes.go#L92: assert(!isTypeParam(T))
sizes.go#L170: assert(isTyped(T))
sizes.go#L224: assert(!isTypeParam(T))
sizes.go#L341: assert(x >= 0 && 1 <= a && a <= 8 && a&(a-1) == 0)
stmt.go#L353: assert(T != nil)
stmt.go#L406: assert(T != nil)
stmt.go#L419: assert(scope == check.scope)
subst.go#L21: assert(len(tpars) == len(targs))
subst.go#L32: assert(len(from) == len(to))
subst.go#L59: assert(expanding != nil || ctxt != nil)
subst.go#L204: assert(t.complete) // otherwise we are copying incomplete data
typeset.go#L119: assert(t.typ != nil)
typeset.go#L126: assert(Identical(u, u.Underlying()))
typeset.go#L143: assert(t.typ != nil)
typeset.go#L273: assert(!isTypeParam(typ))
typeset.go#L292: assert(!tset.comparable)
typeset.go#L293: assert(len(tset.methods) == 0)
typeset.go#L336: assert(t.typ != nil)
typeset.go#L347: assert(!comp || terms.isAll()) // comparable invariant
typeset.go#L389: assert(!isTypeParam(t.typ))
typestring.go#L86: assert(ctxt != nil)
typestring.go#L362: assert(w.ctxt != nil)
typestring.go#L482: assert(w.tparams == nil)
typexpr.go#L78: assert(typ != nil)
typexpr.go#L107: assert(x.val != nil)
typexpr.go#L194: assert(isTyped(typ))
typexpr.go#L212: assert(isTyped(typ))
unify.go#L92: assert(len(tparams) >= len(targs))
unify.go#L226: assert(hx != nil)
unify.go#L242: assert(t != nil)
unify.go#L348: assert(!isTypeParam(y))
unify.go#L452: assert(x != y && Unalias(x) != Unalias(y))
unify.go#L660: assert(!u.enableInterfaceInference || mode&exact != 0) // handled before this switch
unify.go#L758: assert(u.asBoundTypeParam(x) == nil)
union.go#L56: assert(len(blist) == len(tlist)-1)
union.go#L172: assert(!IsInterface(y.typ))
universe.go#L291: assert(obj.Type() != nil)
validtype.go#L122: assert(t.obj.pkg == check.pkg)
validtype.go#L123: assert(t.Origin().obj.pkg == check.pkg)
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64)